package StudyCode.summary.mycollection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class MultipliesTheArrayByAConstantFactorInPlace {
	public static void multiply(double[] input, double factor) {
		for (int i = 0; i < input.length; i++) {
			input[i] = input[i] * factor;
		}
	}


	public static double[] multiply(double[] first, double[] second) {
		double[] result = new double[first.length];
		for (int i = 0; i < result.length; i++) {
			result[i] = first[i] * second[i];
		}
		return result;
	}
}
